<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<body>
<head>
    <%@ include file="/WEB-INF/admin/common/base.jsp" %>
    <jsp:include page="/WEB-INF/admin/common/head.jsp"/>
    <title>Jblog admin</title>
</head>


<div id="wrapper">
    <!-- Navigation -->
    <jsp:include page="/WEB-INF/admin/common/navi.jsp"/>

    <div id="page-wrapper" style="min-height: 491px;">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">菜单管理</h1>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-10">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        ${id==null?"添加":"修改"}菜单
                    </div>
                    <div class="panel-body">

                        <c:if test="${!empty errors}">
                            <div class="form-group has-error">
                                <c:forEach items="${errors}" var="error">
                                    <label class="control-label">${error}</label><br>
                                </c:forEach>
                            </div>
                        </c:if>

                        <div class="row">
                            <div class="col-lg-6">
                                <form role="form" action="<%=adminBasePath%>menu/menuAdd" name="menuform" id="menuform" method="post">
                                    <div class="form-group">
                                        <label>菜单名</label>
                                        <input class="form-control" name="name">
                                    </div>
                                    <div class="form-group">
                                        <label>上级菜单</label>
                                        <select class="form-control" name="parentId">
                                            <option value="0">无</option>
                                            <c:forEach items="${menus}" var="menu">
                                                <option value="${menu.id}">${menu.name}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label>类型</label>
                                        <select class="form-control" name="type">
                                            <option value="0">菜单</option>
                                            <option value="1">按钮</option>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label>链接</label>
                                        <input class="form-control" name="url">
                                    </div>
                                    <div class="form-group">
                                        <label>资源</label>
                                        <input class="form-control" name="permission">
                                    </div>
                                    <div class="form-group">
                                        <label>是否可用</label>
                                        <select class="form-control" name="available">
                                            <option value="0">不可用</option>
                                            <option value="1" selected>可用</option>
                                        </select>
                                    </div>

                                    <button type="submit" class="btn btn-default">提交</button>
                                    <button type="reset" class="btn btn-default">重置</button>
                                </form>
                            </div>
                            <!-- /.col-lg-6 (nested) -->

                            <!-- /.col-lg-6 (nested) -->
                        </div>
                        <!-- /.row (nested) -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
    </div>
</div>
<!-- /#wrapper -->

<jsp:include page="/WEB-INF/admin/common/bottom.jsp"/>
<script src="<%=basePath%>static/jquery-validation/jquery.validate.js"></script>
<script src="<%=basePath%>static/js/admin/user/userView.js"></script>
</body>
</html>
